var VerEx = require("./libs/VerbalExpressions.js");

// Create an example of how to test for correctly formed URLs
var tester = VerEx()
    .startOfLine()
    .then("http")
    .maybe("s")
    .then("://")
    .maybe("www.")
    .anythingBut(" ")
    .endOfLine();

// Create an example URL
var testMe = "https://www.google.com";

// Use RegExp object's native test() function
if (tester.test(testMe)) console.log("We have a correct URL "); // This output will fire
else console.log("The URL is incorrect");


var tester2 = VerEx()
    .startOfLine()
    .anythingBut(" ")
    .then("abc")
    .anythingBut(" ")
    .endOfLine();

console.log(tester2.source); // Ouputs the actual expression used: /^(http)(s)?(\:\/\/)(www\.)?([^\ ]*)$/
